import request from "@/utils/request";

// 获取商品列表
export const getProductListApi = (data) => {
  return request({
    url: "/product/list",
    method: "post",
    data,
  });
};

// 添加商品
export const addProductApi = (data) => {
  return request({
    url: "/product/save",
    method: "post",
    data,
  });
};

// 修改商品
export const updateProductApi = (data) => {
  return request({
    url: "/product/update",
    method: "post",
    data,
  });
};

// 获取奖池等级
export function getPrizeListApi() {
  return request({
    url: "/prize/list",
    method: "get",
  });
}

// 添加奖品
export const addPrizeApi = (data) => {
  return request({
    url: "/prize/add",
    method: "post",
    data,
  });
};

// 修改奖品
export const updatePrizeApi = (data) => {
  return request({
    url: "/prize/update",
    method: "post",
    data,
  });
};

// 启用禁用奖品
export const updatePrizeStatusApi = (data) => {
  return request({
    url: "/prize/updateStatus",
    method: "post",
    data,
  });
};

// 获取积分记录
export function selectWithdrawalRecordApi() {
  return request({
    url: "/withdrawal/selectWithdrawalRecordByUserId",
    method: "get",
  });
}

// 积分提现审核
export const withdrawalAuditApi = (data) => {
  return request({
    url: "/withdrawal/audit",
    method: "post",
    data,
  });
};

// 用户团队信息
export const systemUserTeamApi = (data) => {
  return request({
    url: "/system/user/team",
    method: "post",
    data,
  });
};

// 为用户开通会员
export function openMemberApi(data) {
  return request({
    url: "/points/openMember/" + data,
    method: "get",
  });
}

// 首页数据概览
export function getOverviewDataApi(data) {
  return request({
    url: "/data/overview",
    method: "get",
  });
}

// 业绩管理
export const getPerformanceApi = (data) => {
  return request({
    url: "/data/performance",
    method: "post",
    data,
  });
};

// 后台更新快递单号
export const updateTrackingNumberApi = (data) => {
  return request({
    url: "/purchase/record/update/trackingNumber",
    method: "post",
    data,
  });
};

// 添加套餐
export const comboInsertApi = (data) => {
  return request({
    url: "/combo/config/insert",
    method: "post",
    data,
  });
};
// 修改套餐
export const comboUpdateApi = (data) => {
  return request({
    url: "/combo/config/update",
    method: "post",
    data,
  });
};
// 获取套餐列表
export const comboListApi = (data) => {
  return request({
    url: "/combo/config/select",
    method: "post",
    data,
  });
};

// 商城订单列表
export function getPurchaseListApi(data) {
  return request({
    url: "/purchase/record/list",
    method: "post",
    data,
  });
}

// 套餐订单列表
export function getComboListApi(data) {
  return request({
    url: "/combo/order/list",
    method: "post",
    data,
  });
}

// 发货
export function comboUpdateOrApi(data) {
  return request({
    url: "/combo/order/update",
    method: "post",
    data,
  });
}

// 生成卡片
export function comboInsertCardApi(data) {
  return request({
    url: "/combo/card/insert",
    method: "post",
    data,
  });
}

// 作废卡片
export function comboUpdateCardApi(data) {
  return request({
    url: "/combo/card/update",
    method: "post",
    data,
  });
}

// POST 查询卡号列表
export function comboCardListApi(data) {
  return request({
    url: "/combo/card/list",
    method: "post",
    data,
  });
}
